package com.bolehui.web;

import com.bolehui.base.result.Result;
import com.bolehui.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chendongjie     email:chendongjie@gz.iscas.ac.cn
 * @version 1.0
 * @ClassName WebSocketController
 * @Description
 * @createTime 2025/3/15-11:38
 * Copyright (C) 2021-2022 CASEEDER, All Rights Reserved.
 * 注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的
 */
@RestController
@RequestMapping("/message")
public class MessageController {

    @Autowired
    private MessageService messageService;

    @RequestMapping(params = "action=findByConvId")
    public Result findMessageByConvId(Long id){
        return messageService.findMessageByConversationId(id);
    }

    @RequestMapping(params = "action=update")
    public Result updateUnread(Long conversationId, Long senderId){
        return messageService.updateUnreadById(conversationId, senderId);
    }
}
